luci-base: set output elements to use output element type
authorPaul Donald <[email protected]>
Mon, 9 Jun 2025 11:36:44 +0000 (13:36 +0200)
committerPaul Donald <[email protected]>
Mon, 9 Jun 2025 22:06:17 +0000 (00:06 +0200)
Signed-off-by: Paul Donald <[email protected]>
modules/luci-base/htdocs/luci-static/resources/form.js

index f65d25e91aa9e0a8d166bfeda658470b7aa9778d..002c145b7d48e9008e2f987223cff53dab6b875b 100644 (file)
@@ -4530,7 +4530,8 @@ const CBIDummyValue = CBIValue.extend(/** @lends LuCI.form.DummyValue.prototype
        renderWidget(section_id, option_index, cfgvalue) {
                const value = (cfgvalue != null) ? cfgvalue : this.default;
                const hiddenEl = new ui.Hiddenfield(value, { id: this.cbid(section_id) });
-               const outputEl = E('div', { 'style': this.hidden ? 'display:none' : null });
+               const outputEl = E('output', { 'style': this.hidden ? 'display:none' : null,
+                       'for': this.cbid(section_id)});
 
                if (this.href && !((this.readonly != null) ? this.readonly : this.map.readonly))
                        outputEl.appendChild(E('a', { 'href': this.href }));
@@ -4640,7 +4641,7 @@ const CBIButtonValue = CBIValue.extend(/** @lends LuCI.form.ButtonValue.prototyp
        renderWidget(section_id, option_index, cfgvalue) {
                const value = (cfgvalue != null) ? cfgvalue : this.default;
                const hiddenEl = new ui.Hiddenfield(value, { id: this.cbid(section_id) });
-               const outputEl = E('div');
+               const outputEl = E('output', {'for': this.cbid(section_id)});
                const btn_title = this.titleFn('inputtitle', section_id) ?? this.titleFn('title', section_id);
 
                if (value !== false)